package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsGoodsSpecificationMapper;
import com.qf.pojo.DtsGoodsSpecification;
import com.qf.service.DtsGoodsSpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DtsGoodsSpecificationServiceImpl implements DtsGoodsSpecificationService {
    @Autowired
    DtsGoodsSpecificationMapper specificationMapper;

    @Override
    public void insert(DtsGoodsSpecification dtsGoodsSpecification) {
        specificationMapper.insert(dtsGoodsSpecification);
    }

    @Override
    public List<DtsGoodsSpecification> select(Integer goodsId) {
        QueryWrapper wrapper = new QueryWrapper();

        wrapper.eq("goods_id",goodsId);

        List<DtsGoodsSpecification> list = specificationMapper.selectList(wrapper);
        return list;
    }

    @Override
    public void update(DtsGoodsSpecification[] specifications) {

        for (DtsGoodsSpecification specification : specifications) {
            specificationMapper.updateById(specification);
        }
    }


















}
